<include file="../header" />
<div id="left-sider"><include file="../left-sider" /></div>
<div id="main">
  <div class="main-hd">
    <h2>List of fse</h2>
  </div>
  <div class="main-bd">
  <form id="fseToDelForm" action="remove" method="post" target="_self">
    <div>
      <p>
        <input type="submit" value="删除" />
        <a href="create">新增</a></p>
    </div>
    <div>
      <table width="100%" border="1" class="table-list">
        <tr>
          <th><input type="checkbox" id="fseToDelCtrl"/></th>
          <th>Title</th>
          <th>Img</th>
          <th>Language</th>
        </tr>
        <volist name="fses" id="fse">
          <tr>
            <td class="text-center"><input class="fseToDel" type="checkbox" name="fseToDel[]" value="{$fse.id}"/></td>
            <td><a href="edit/id/{$fse.id}" target="_self">{$fse.name}</a></td>
            <td><img src="{$fse.img}" width="200"/></td>
            <td>{$fse.lang}</td>
          </tr>
        </volist>
      </table>
    </div>
    </div>
  </form>
</div>
<include file="../footer" /> 
<script type="text/javascript">
var fseToDel = document.querySelectorAll('.fseToDel');
document.getElementById('fseToDelCtrl').addEventListener('click',function(){
        if(this.checked) {
            for(var i=0; i<fseToDel.length; i++) {
                fseToDel[i].checked = true;
            }
        } else {
            for(var i=0; i<fseToDel.length; i++) {
                fseToDel[i].checked = false;
            }
        }
}, false);

document.getElementById('fseToDelForm').addEventListener('submit',function(e){
        if(!confirm('删除后无法恢复，你是否要继续？')) {
                e.preventDefault();
                return false;
        }
}, false);
</script>